<?php

namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use App\Models\Expert;
use App\Models\Video;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    //
    public function __invoke(Request $request)
    {
        $oexperts = Expert::paginate(2);
        $ovideos = Video::paginate(2);
        $latestStartTime = DB::table('videos')->min('begin');
        return view('front.index')
            ->with('oexperts',$oexperts)
            ->with('ovideos',$ovideos)
            ->with('latestStartTime', $latestStartTime)
            ;
    }
}
